var ReservationsUpdateFollowerLog = {
    id: "ReservationsUpdateFollowerLogTable",
    seItem: null,
    table: null,
    layerIndex: -1
};
ReservationsUpdateFollowerLog.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '', field: 'id', visible: false, align: 'center', valign: 'middle', width: '50px'},
        {title: '修改人', field: 'updatePeople', align: 'center', valign: 'middle', sortable: true},
        {
            title: '修改时间', field: 'updateTime', align: 'center', valign: 'middle', sortable: true,
            formatter: function (value, row, index) {
                return value.substring(0, 19);
            }
        },
        {title: '修改患者姓名', field: 'updateCname', align: 'center', valign: 'middle', sortable: true},
        {title: '修改患者电话', field: 'updateCphone', align: 'center', valign: 'middle', sortable: true},
        {title: '原跟进人', field: 'followery', align: 'center', valign: 'middle', sortable: true},
        {title: '新更进人', field: 'followerx', align: 'center', valign: 'middle', sortable: true},
        {title: '建档人', field: 'archiving', align: 'center', valign: 'middle', sortable: true},
        {
            title: '建档时间', field: 'filingTime', align: 'center', valign: 'middle', sortable: true,
            formatter: function (value, row, index) {
                return value.substring(0, 19);
            }
        },
    ];
};
ReservationsUpdateFollowerLog.formParams = function () {
    var queryData = {};
    queryData['archiving'] = $("#archiving").val();
    queryData['updateCphone'] = $("#updateCphone").val();
    queryData['startTime'] = $("#startTime").val();
    queryData['endTime'] = $("#endTime").val();
    return queryData;
}
ReservationsUpdateFollowerLog.resetSearch = function () {
    $("#updateCphone").val("");
    $("#archiving").val("");
    $("#startTime").val("");
    $("#endTime").val("");
    ReservationsUpdateFollowerLog.search();
};
ReservationsUpdateFollowerLog.search = function () {
    ReservationsUpdateFollowerLog.table.refresh({query: ReservationsUpdateFollowerLog.formParams()});
};
ReservationsUpdateFollowerLog.today = function () {
    $("#startTime").val(setDateTime(new Date(),0) + " " + "00:00:00");
    $("#endTime").val(setDateTime(new Date(),0) + " " + "23:59:59");
    ReservationsUpdateFollowerLog.search();
};
$(function () {
    var defaultColunms = ReservationsUpdateFollowerLog.initColumn();
    var table = new BSTable(ReservationsUpdateFollowerLog.id, "/reservationsLog/updateFollowerList", defaultColunms);
    table.setPaginationType("server");
    table.setQueryParams(ReservationsUpdateFollowerLog.formParams());
    ReservationsUpdateFollowerLog.table = table.init();
    ReservationsUpdateFollowerLog.table = table;
    ReservationsUpdateFollowerLog.today();
    $(document).on('click','#laydate_clear,#laydate_today,#laydate_ok',function () {ReservationsUpdateFollowerLog.search();});
    checkDate = function () {ReservationsUpdateFollowerLog.search();};
});